//------------------------------------------------------------------------
// Abstract: Implement of class DBAdministrator
//
// Authoring: XiaoHanxiong
//
// Time: 2014.03.14
//
// Static test:
//
// Version history:
//		Ver_1.0	: 2014.03.14	XiaoHanxiong
//------------------------------------------------------------------------
#include "Stdafx.h"
#include "DBAdministrator.h"
#include "SQLiteDB.h"

namespace Database
{
	DBAdministrator::DBAdministrator()
	{

	}

	DBAdministrator::~DBAdministrator()
	{

	}

	IDatabase* DBAdministrator::Create( DatabaseType type ) /*static*/
	{
		switch(type)
		{
		case SQLite:
			return new SQLiteDB();
			break;

		default:
			return NULL;
		}
	}

	void DBAdministrator::Destory( IDatabase* database ) /*static*/
	{
		if(database != NULL)
			delete database;
		database = NULL;
	}

	DatabaseType DBAdministrator::GetDatabaseType( IDatabase* database )
	{
		return database->m_type;
	}
}